The present invention relates to an image reading apparatus for optically reading an original and a method of determining a gain value and an offset value for the image reading apparatus, especially a method of determining a gain value and an offset value in a short period of time.
A signal processing section of a conventional image reading apparatus mounted on a copy machine or a facsimile is schematically illustrated in FIG. 19. As shown in FIG. 19, an original or a reference white plate is irradiated with light, and light reflected from the original or the reference white plate is converted to an analog signal by a linear sensor 1000 comprising a plurality of photoelectric conversion elements. The analog signal outputted from the sensor 1000 is inputted to an adjusting circuit 1002 via a sample hold circuit 1001 for gain processing and offset processing in the adjusting circuit, and an A/D converter 1003 converts to a digital signal. After an image processor 1004 performs various image-processing such as shading correction and gamma correction, the digital signal is outputted as an image data to an external apparatuses such as a printer.
In the gain processing and the offset processing performed at the adjusting circuit, as disclosed in Japanese Patent Publication No. 10-233903, a voltage of the analog signal is adjusted to be within a resolution range of the A/D converter, so that proper graduation is obtained according to the resolution of the A/D converter. That is, the analog signal is amplified in the gain processing, and a dark current value is lowered in the offset processing. A gain value for the gain processing and an offset value for the offset processing are set in a first register 1005 and a second register 1006, respectively. It is necessary to set these values each time the apparatus is turned on or the original is scanned.
A conventional method of setting the gain value and the offset value will be described below. FIG. 11 is a graph for explaining the resolution of the A/D converter. The A/D converter shown in FIG. 11 has an input voltage range of about 0 to 5 V and the resolution of 10 bits (resolution: 1024 levels from 0 through 1023). A threshold value L2 is set to be a level where an output value of the A/D converter becomes close to the maximum resolution 1023, and a threshold value L1 is set to be a level where the output value of the A/D converter becomes close to the minimum resolution 0. Incidentally, the offset value settable in the first register 1005 and the gain value settable in the second register 1006 are 8 bits (0 to 255).
An offset adjustment for determining the offset value is performed as follows. First, an offset value 0 is set in the register 1005, and a gain value 0 is set in the second register 1006. While a light source is turned off, the reference white plate in a scanning unit of the image reading apparatus is scanned for one line. The analog signal corresponding to the one line is outputted from the sensor 100, and the offset processing and the gain processing are performed based on the offset value 0 in the first register 1005 and the gain value 0 in the second register 1006. The analog signal is then converted to the digital signal by the A/D converter 1003. The digital signal is compared with the threshold value L1 for each pixel in the comparator circuit 1007 to determine whether the digital signal from the A/D converter 1003 has a predetermined level (close to the threshold value L1).
When the digital signal is determined to have the predetermined level, the offset value (0 in this case) set in the first register 1005 is adopted as the predetermined offset value (Of). When the digital signal is determined not to have the predetermined level, these steps are repeated until the predetermined offset value (Of) is obtained while re-writing the offset value in the first register 1005.
Next, a gain adjustment is performed for obtaining the gain value. First, the offset value (Of) obtained through the offset adjustment process is set in the first register 1005, while the gain value 0 is set in the second register 1006. While the light source is turned on, the reference white plate in the scanning unit of the image reading apparatus is scanned for one line. The analog signal corresponding to the one line is outputted from the sensor, and the offset processing based on the offset value (Of) set in the first register 1005 and the gain processing based on the gain value (0) set in the second register 1006 are performed. The analog signal is then converted to the digital signal by the A/D converter 1003. The digital signal is compared with the threshold value L2 for each pixel to determine whether the digital signal has a predetermined level (close to the threshold value L2).
When the digital signal is found to have the predetermined level, the gain value (0 in this case) set in the second register 1006 is adopted as the gain value (Ga). When the digital signal is found not to have the predetermined level, these steps are repeated until the predetermined level is obtained while re-writing the gain value set in the second register 1006.
The gain value (Ga) is obtained through the method described above. However, the dark current increases when the gain value changes. Accordingly, it is necessary to adjust the offset value one more time to obtain the offset value for the gain value (Ga). That is, until the analog signal becomes the predetermined level (close to the threshold value L2) while the light source is turned on to scan the reference white plate, and the analog signal becomes the predetermined level (close to the threshold value L1) while the light source is turned off, it is necessary to repeat the offset adjustment and the gain adjustment.
In the conventional image reading apparatus, when the gain value and the offset value have the setting ranges of 8 bits, it is necessary to re-write the gain value 256 times at most and adjust the offset each time, thereby taking long time for scanning 256×256×1 lines and processing each scan. Accordingly, when the gain adjustment and the offset adjustment are performed upon turning on the power source, it takes long time to start up due to the long initial processing. Further, when the gain adjustment and offset adjustment are performed each time the original is read, a long time is required before scanning the first original.
In view of the problems described above, an object of the present invention is to provide a method of determining the gain value and the offset value in a short period of time, and an image reading apparatus capable of determining the gain value and the offset value in a short period of time.
Further objects and advantages of the invention will be apparent from the following description of the invention.